import Vue from 'vue'
import 'normalize.css/normalize.css' // a modern alternative to CSS resets
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import '@/styles/index.scss' // global css
import VueClipboard from 'vue-clipboard2'
import App from './App'
import store from './store'
import router from './router'

import Api from './api';
import TimeZone from './utils/timezone';
import Validator from '@/utils/validator';
import Datetime from '@/utils/datetime';
import './icons' // icon 图标
import './permission' // permission control

import '@/directive/permission.js';
import '@/utils/message.js';
import '@/utils/confirm.js';
import quillEditor from 'vue-quill-editor';
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import __globalHandleResponseMixin from '@/mixins/globalHandleResponseMixin.js';

import * as filters from './filters' // global filters

//导入自定义的iconfont字体
// import "@/assets/iconfont/iconfont.css"

//树形菜单转化
Vue.config.productionTip = false;
Vue.prototype.$api = Api;
Vue.prototype.$validator = Validator;
Vue.prototype.$datetime = Datetime;
Vue.prototype.$timeZone = 'asia/shanghai';
Vue.prototype.$tz = new TimeZone({ tz: Vue.prototype.$timeZone });
Vue.prototype.$moment = Vue.prototype.$tz.moment;

Vue.use(ElementUI);
Vue.use(VueClipboard)
Vue.use(quillEditor)

Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

Vue.config.productionTip = false

Vue.mixin(__globalHandleResponseMixin)

// 加载资源
new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App),
})
